/****************************************************************
 * I am the AC 130 vs Pirate game. I allow the user to control an 
 * AC130 gunship in the hunt for Modern day pirates. The player  
 * will be allowed to roam free across a section of ocean/coastline.  
 * In the water there will be four types of vessels: Merchant  
 * ships that the player must protect, Pirate ships that the player  
 * must identify and destroy, Fishing boats that look like Pirate  
 * ships that the player must not destroy, and Friendly Navy ships  
 * that can capture pirates for extra points. Time permitting there  
 * may also be ground targets to attack. 
 *
 * Key elements of this project will be the Player/AC130, the Ships,  
 * the ShipAI system, the collision grid, the debris controller, the  
 * Ground/Water, Clouds, and scoring system. This project will make  
 * use of an external text file to store useful game parameters,  
 * thus allowing us to play balance the game without recompiling  
 * the executable. 
 *****************************************************************
 * I am the Game Data class. I contain all the data that needs to 
 * be shared between screens. I also contain a hash table for data 
 * read in from a file.
 *****************************************************************/

#include "HashNode.h"
#include <allegro.h>
#include <stdio.h>

#ifndef __GAME_DATA_H__
#define __GAME_DATA_H__

#define HASHTBLMAX 512
enum tpScreenType {stIntro, stMainMenu, stGamePlay, stQuit};

class GameData {
private:
		//hash table
	HashNode * hashTable[HASHTBLMAX];
public:
		// value of input on last cycle
	int mouseX;
	int mouseY;
	bool lmouse;
	bool rmouse;
	bool oldKey[KEY_MAX];
		// text values
	char debugTxt[HASHSTRLEN];
	char hashRet[HASHSTRLEN];	// return string of latest GetStr request
		// this is a enum so we don't need a star
	tpScreenType nxtScreen;	// the screen that we will go to on the screen swap
private:
	int GetHash(char * key);
	void AddNumToHash(char * key, char * val);
	void AddStrToHash(char * key, char * val);
	void ReadFile(FILE *fin);
public:
	GameData();
	~GameData();
	
	float GetNum(char * key);
	char * GetStr(char * key);
};

#endif